package com.big.squirrel.guitar.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Closeable;
import java.io.IOException;

/**
 * @author 80002442 <p>
 * @date 2020-1-6 14:31 <p>
 * @projectName big-squirrel-guitar-micro <p>
 * @packageName IOUtils <p>
 * @dayNameFull 星期一 <p>
 * @description <p>
 */
public class IOUtils {
    private static final Logger logger = LoggerFactory.getLogger(IOUtils.class);

    private IOUtils() {
    }

    public static void close(Closeable... closeables) {
        if (closeables == null || closeables.length <= 0) {
            return;
        }
        for (Closeable closeable : closeables) {
            if (closeable == null) {
                continue;
            }
            try {
                closeable.close();
            } catch (IOException e) {
                logger.error("IOUtils close error!", e);
            }
        }
    }
}
